<template>
	<view class="">
		<u-navbar :border-bottom="false" is-fixed title-color="#fff" :background="{background:'#fff0'}" immersive />
		<view class="" style="margin-bottom: -60rpx;">
			<image :src="data.image" @click="$advJump(data)" class="w-max h460 db" mode=""></image>
		</view>
		<view class="p20  relative" style="margin-top: -150rpx;">
			<view class="bg-fff radius20 p20">
				<view class="color-red fs38 fw-700" v-if="data.suggested_price">
					<text>{{data.suggested_price}}</text>
					<text class="fs24 fw-500">元/{{data.unit||'次'}}</text>
				</view>
				<view class="mt10 fw-w fs30">{{data.service_name||data.name}}</view>
				<view class="mt10 color-666">{{data.introduce}}</view>
				<view class="mt10 lh15 fs26 ">
					<text>{{data.describe}}</text>
				</view>
			</view>

			<!-- 	<view class="radius20 bg-fff m20 pb28" v-if="$params.om_service_id">
				<image src="/static/img/index/pzs.png" class="h86 w-max " mode=""></image>
				<view class="pt32 pl20 flex">
					<image :src="data.avatar" class="h92 w92 radius" mode="aspectFill"></image>
					<view class="pl24">
						<view class="fs28 color-232323 fw-700">{{data.name}}</view>
						<view class="flex mt12">
							<view class="radius8 blue px20 py6 mr20">{{$list().identity[data.type]}}</view>
							<view class="radius8 yellow px20 py6">已实名</view>
						</view>
					</view>
				</view>
				<view class="pl20 mt26">
					<text class="color-999 fs26">陪诊价格：</text>
					<text class="color-zs">{{data.price}}</text>
					<text class="color-999 fs26">元起</text>
				</view>
				<view class="pl20 mt16">
					<text class="color-999">陪诊项目：</text>
					<text class="color-666">{{data.service}}</text>
				</view>
			</view> -->

			<view class="">
				<view class="flex row-around col-top mt30">
					<view v-for="(item,index) in tablist" :key="index" class="flex flex-col flex1"
						@click="change(index)">
						<view class="">{{item}}</view>
						<view class="h10 w10 radius bg-zs mt12" v-if="current==index"></view>
					</view>
				</view>
			</view>
			<view class="bg-fff radius20 p30 mt20" v-if="current==0&&data.content">
				<u-parse :html="data.content||''" :domain="$baseUrl" />
			</view>
			<view class="bg-fff radius20 p30 mt20" v-if="current==1&&data.notice">
				<u-parse :html="data.notice||''" :domain="$baseUrl" />
			</view>
		</view>

		<!-- <view class="h120"></view>
		<view class="pf bottom0 left0 bg-fff w-max">
			<view class="p20">
				<u-button type="warning" ripple @click="submit">立即预约</u-button>
			</view>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tablist: ['服务内容', '服务须知'],
				current: 0,

				data: '',
			};
		},
		onLoad() {
			this.getData()
		},
		methods: {
			change(index) {
				this.current = index
			},
			getData() {
				let api = "/member/index/serviceInfo"
				// if (this.$params.service_id) api = '/member/index/serviceInfo'
				// if (this.$params.om_service_id) api = '/member/search/serviceInfo'
				this.$request(api, this.$params).then(res => {
					let data = res.data.data || res.data || ''
					this.data = data
					uni.setNavigationBarTitle({
						title: data.name
					})
					this.shareData.title = this.$config.shop_title + ' ' + data.name
				})
			},
			submit() {
				let data = this.data
				if (data.is_car) return this.$jump('/pages/index/demo/car')
				let params = {
					...this.$params,
					master_id: data.master_id,
					organ_id: data.organ_id,
					hospital_id: data.hospital_id,
				}
				params.service_id = data.service_id || data.id || data.om_service_id
				this.$jump('/pages/index/demo/downOrder', params)
			}
		}
	}
</script>

<style>
</style>